CURRENT_DIR:=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))

include ../config.mk

.PHONY: all clean
.DEFAULT_GOAL = all

all:
	@mkdir -p $(PAPER_OUT_DIR)
	cd gen_baseline_outputs && make
	cd gen_realized_risk_table && make
	cd gen_primary_outcomes_table && make
	cd gen_outcome_by_subgroup_outputs && make
	cd gen_separated_outcomes_table && make
	cd gen_other_outcomes_table && make
	cd gen_payroll_outputs && make
	cd gen_retention_plots && make
	cd gen_covid_outputs && make
	cd gen_alternate_spec_outputs && make
	cd gen_incapacitation_scaled_table && make
	cd gen_benefit_cost_outputs && make
	cd gen_benefit_cost_appendix_outputs && make
	cd gen_shoot_homs_per_capita && make
	cd gen_time_varying_itt_outputs && make
	cd gen_takeup_model_outputs && make
	cd gen_outreach_model_outputs && make
	cd gen_pathway_reweighted_table && make
	cd gen_pathway_risk_plots && make
	cd gen_time_of_day_outputs && make
	cd gen_prog_component_importance_table && make
	cd gen_dosage_outputs && make
	cd gen_RI_estimate_table && make
	cd post_process_paper_output && make

clean:
	cd gen_baseline_outputs && make clean
	cd gen_realized_risk_table && make clean
	cd gen_primary_outcomes_table && make clean
	cd gen_outcome_by_subgroup_outputs && make clean
	cd gen_separated_outcomes_table && make clean
	cd gen_other_outcomes_table && make clean
	cd gen_payroll_outputs && make clean
	cd gen_retention_plots && make clean
	cd gen_covid_outputs && make clean
	cd gen_alternate_spec_outputs && make clean
	cd gen_incapacitation_scaled_table && make clean
	cd gen_benefit_cost_outputs && make clean
	cd gen_benefit_cost_appendix_outputs && make clean
	cd gen_shoot_homs_per_capita && make clean
	cd gen_time_varying_itt_outputs && make clean
	cd gen_outreach_model_outputs && make clean
	cd gen_takeup_model_outputs && make clean
	cd gen_pathway_reweighted_table && make clean
	cd gen_pathway_risk_plots && make clean
	cd gen_time_of_day_outputs && make clean
	cd gen_prog_component_importance_table && make clean
	cd gen_dosage_outputs && make clean
	cd gen_RI_estimate_table && make clean
	rm -rf $(PAPER_OUT_DIR)

clean_for_overleaf:
	rm ./*/output/*_up_to_date*
	rm -rf $(PAPER_OUT_DIR)
